﻿import 'package:star_author/generated/json/base/json_convert_content.dart';
import 'package:star_author/model/compensate_entity.dart';

CompensateEntity $CompensateEntityFromJson(Map<String, dynamic> json) {
	final CompensateEntity compensateEntity = CompensateEntity();
	final List<CompensateData>? data = jsonConvert.convertListNotNull<CompensateData>(json['data']);
	if (data != null) {
		compensateEntity.data = data;
	}
	return compensateEntity;
}

Map<String, dynamic> $CompensateEntityToJson(CompensateEntity entity) {
	final Map<String, dynamic> data = <String, dynamic>{};
	data['data'] =  entity.data?.map((v) => v.toJson()).toList();
	return data;
}

CompensateData $CompensateDataFromJson(Map<String, dynamic> json) {
	final CompensateData compensateData = CompensateData();
	final int? id = jsonConvert.convert<int>(json['id']);
	if (id != null) {
		compensateData.id = id;
	}
	final String? createdAt = jsonConvert.convert<String>(json['created_at']);
	if (createdAt != null) {
		compensateData.createdAt = createdAt;
	}
	final String? price = jsonConvert.convert<String>(json['price']);
	if (price != null) {
		compensateData.price = price;
	}
	return compensateData;
}

Map<String, dynamic> $CompensateDataToJson(CompensateData entity) {
	final Map<String, dynamic> data = <String, dynamic>{};
	data['id'] = entity.id;
	data['created_at'] = entity.createdAt;
	data['price'] = entity.price;
	return data;
}